<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<div id="header">
	
	<!-- 用户信息条-->
	<div id="user-tip">
		<s:if test="#session.current_user != null">
			<font color="white">欢迎：</font>
			<a id="user_url" href="#"><font color="red"><s:property value="#session.current_user"/></font></a>|
			<a id="user_logout" href="#">注销</a>|
		</s:if>
		<s:else>
			<a id="user_login" href="#">用户登录</a>|
		</s:else>
		<a id="user_regist" href="#">新用户注册</a>|
		<a>常见问题解答</a>
	</div>


	<!-- 系统信息条-->
	<div id="sys-tip">
		<div id="sys-clock"></div>
	</div>
		
			
	<!-- logo标识 -->
	<div id="logo">
		<h1><a href="#">Collapsar</a></h1>
		<p><em>template design by <a href="#">BrianChen</a></em></p>
	</div>

</div>



<div id="user_login_widget" style="display:none; cursor: default;width:500px; height:200px;background-color:#D2E6FA;"> 
	<form action="/snail/user/loginAction.action" method="post">
		<div id="title">个人登录后才能进行相关操作，没有注册请先注册成为个人会员。</div>
    	<div style="width:320px;height:80px;margin:0px auto;">
                                     帐号：<input type="text" name="account" /><br>
                                     密码：<input type="password" name="passwd" /><br>
           <input type="submit" value="登录"/><br>
    	</div>
    	<div id="forget" align="center">
    		<a href="#">忘记密码？</a>
        	<a href="#">没有注册？</a>
    	</div>
    	<div style="height:25px;line-height:25px;text-align:center">马上注册并完成个人信息，你就会得到更多更好的机会。 <a style="color:#06F;text-decoration:underline;font-weight:700" href="#">点击注册</a></div>
	</form>
</div>



<script type="text/javascript">
	$(document).ready(function(){
		//启动系统时钟
		setInterval("sysClock()", 1000);

		//用户注册
		$("#user_regist").click(function(){
			$(this).attr("href", "/snail/user/user_regist.jsp");
		});
		
		//用户登录
		$("#user_login").click(function(){
			$.blockUI({ message: $('#user_login_widget')}); 
		});
		
		//用户注销
		$("#user_logout").click(function(){
			$(this).attr("href", "/snail/user/logoutAction.action");
		});
		
		//用户url链接
		$("#user_url").click(function(){
			var userAccount = '<%=session.getAttribute("current_user")%>';
			//alert(userAccount);
			$(this).attr("href", "/snail/user/queryDetailAction.action?userAccount="+userAccount);
		});
	});
		
	//系统时钟
	function sysClock(){
		var sysTime = new Date();
		var year = sysTime.getFullYear();
		var month = sysTime.getMonth()+1;
		month = month>9 ? month : "0"+month;
		var day = sysTime.getDate();
		day = day>9 ? day : "0"+day;
		var hours = sysTime.getHours();
		hours = hours>9 ? hours : "0"+hours;
		var minutes = sysTime.getMinutes();
		minutes = minutes>9 ? minutes : "0"+minutes;
		var seconds = sysTime.getSeconds();
		seconds = seconds>9 ? seconds : "0"+seconds;
		var week = sysTime.getDay();
		switch(week){
		case 1: week="星期一"; break;
		case 2: week="星期二"; break;
		case 3: week="星期三"; break;
		case 4: week="星期四"; break;
		case 5: week="星期五"; break;
		case 6: week="星期六"; break;
		case 7: week="星期日"; break;
		}
		var sysTimeStr = "当前系统时间："+year+"-"+month+"-"+day+" "+hours+":"+minutes+":"+seconds+" "+week;
		$("#sys-clock").html(sysTimeStr);
	}
</script>

